<?php
/**
 * Created by PhpStorm.
 * User: zd
 * Date: 2018/12/8
 * Time: 14:51
 */

namespace app\api\service;


use app\api\model\WorkWordClassify;
use app\api\model\WorkWord as WorkWordModel;

class WorkWord
{
    /**
     * 添加分类
     * @param $info
     * @param $uid
     * @return false|int
     */
    public function addWordClassify($info,$uid){
        $data= $info;
        $data['t_id'] = $uid;
        $word = WorkWordClassify::addWordClassify($data);
        return $word;
    }

    /**
     * 删除分类
     * @param $id
     * @return int
     */
    public function deleteClassify($id){
        $word = WorkWordClassify::deleteClassify($id);
        return $word;
    }

    /**
     * 更新话术分类
     * @param $info
     * @return false|int
     */
    public function updateClassify($info){
        $word = WorkWordClassify::updateClassify($info);
        return $word;
    }

    /**
     * 获取话术分类列表
     * @param $t_id
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getClassify($t_id){
        $word = WorkWordClassify::getClassify($t_id);
        return $word;
    }

    /**
     * 添加话术类容
     * @param $info
     * @return false|int
     */
    public function addWord($info,$uid){
        $info['t_id'] = $uid;
        $word = WorkWordModel::addWord($info);
        return $word;
    }

    /**
     * 获取话术类容
     * @param $id
     * @return null|static
     */
    public function getWord($id){
        return WorkWordModel::getWord($id);
    }

    /**
     * 更新话术库
     * @param $info
     * @return false|int
     */
    public function updateWord($info,$uid){
        $id = $info['id'];
        $info['t_id'] = $uid;
        $word = WorkWordModel::updateWord($info,$id);
        return $word;
    }
    /**
     * 删除话术库
     * @param $id
     * @return int
     */
    public function deleteWord($id){
        $word = WorkWordModel::deleteWord($id);
        return $word;
    }

    /**
     * 获取话术库列表
     * @param $t_id
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getWordList($t_id,$c_id){
        $word = WorkWordModel::getWordList($t_id,$c_id);
        return $word;
    }

    /**
     * 更具分类获取话术列表
     * @param $uid
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getWordByCategory($uid,$categoryID){
        $word = WorkWordModel::getWordByCategory($uid,$categoryID);
        return $word;
    }
    /**
     * 根据用户id获取话术分类列表
     * @param $uid
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getClassifyBuUid($uid){
        $word = WorkWordClassify::getCalssifyByUid($uid);
        return $word;
    }
    /**
     * 用户自定义添加话术
     * @param $info
     * @return false|int
     */
    public function addUserWord($info,$uid){
        $word = WorkWordModel::addUserWord($info,$uid);
        return $word;
    }
    /**
     * 更新自定义话术
     * @param $info
     * @param $uid
     * @return false|int
     */
    public function updateUserWord($info,$uid){
        $word = WorkWordModel::updateUserWord($info,$uid);
        return $word;
    }

    /**
     * 获取自定义话术列表
     * @param $uid
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getUserWordList($uid){
        $word = WorkWordModel::getUserWordList($uid);
        return $word;
    }



}